﻿using System;
using System.Xml.Serialization;

namespace ExcelAutomator.Configuration
{
	[Serializable]
	[XmlType("RangeConfiguration", Namespace = Constants.ExecutorExtensionsNamespace)]
	[XmlRoot("range")]
	public class RangeConfiguration: ExecutorConfigurationBase
	{
		public const string SourceAddressAttributeName = "sourceAddress";
		public const string TargetAddressAttributeName = "targetAddress";

		#region SourceAddress

		private string m_SourceAddress;
		[XmlAttribute(SourceAddressAttributeName)]
		public string SourceAddress
		{
			get
			{
				if(string.IsNullOrEmpty(m_SourceAddress))
				{
					return string.Empty;
				}
				return m_SourceAddress;
			}
			set { m_SourceAddress = value; }
		}

		#endregion

		#region TargetAddress

		private string m_TargetAddress;
		[XmlAttribute(TargetAddressAttributeName)]
		public string TargetAddress
		{
			get
			{
				if (string.IsNullOrEmpty(m_TargetAddress))
				{
					return string.Empty;
				}
				return m_TargetAddress;
			}
			set { m_TargetAddress = value; }
		}

		#endregion

		[XmlAttribute("rowHeight")]
		public string RowHeight { get; set; }

		[XmlAttribute("entireRow")]
		public bool EntireRow { get; set; }

		#region Value

		private string m_Value;
		[XmlAttribute("value")]
		public string Value
		{
			get
			{
				if (string.IsNullOrEmpty(m_Value))
				{
					return string.Empty;
				}
				return m_Value;
			}
			set { m_Value = value; }
		}

		#endregion

		

		
	}
}
